﻿using System;

namespace IOA.MES.DataAccess.VModel
{
    /// <summary>
    /// 降级表
    /// </summary>
    public class VDowngrade : BaseVModel
    {
        private string _orderNo = string.Empty;
        private string _workOrderNo = string.Empty;
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;
        private string _barCode = string.Empty;
        private string _productCode = string.Empty;
        private string _productName = string.Empty;
        private string _qLevel = string.Empty;
        private string _downgradeBadTypeName = string.Empty;
        private string _downgradeBadCode = string.Empty;
        private string _downgradeBadName = string.Empty;
        private string _reviewLevel = string.Empty;
        private string _reviewBadTypeName = string.Empty;
        private string _reviewBadCode = string.Empty;
        private string _reviewBadName = string.Empty;
        private string _productSpecs = string.Empty;
        private string _downgradeBadTypeCode = string.Empty;
        private string _reviewBadTypeCode = string.Empty;

        #region Public Property

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 组件条码
        ///</Summary>
        public string BarCode
        {
            get { return string.IsNullOrWhiteSpace(_barCode) ? string.Empty : _barCode; }
            set { _barCode = value; }
        }

        ///<Summary>
        /// 组件料号
        ///</Summary>
        public string ProductCode
        {
            get { return string.IsNullOrWhiteSpace(_productCode) ? string.Empty : _productCode; }
            set { _productCode = value; }
        }

        ///<Summary>
        /// 组件名称
        ///</Summary>
        public string ProductName
        {
            get { return string.IsNullOrWhiteSpace(_productName) ? string.Empty : _productName; }
            set { _productName = value; }
        }

        ///<Summary>
        /// 组件规格
        ///</Summary>
        public string ProductSpecs
        {
            get { return string.IsNullOrWhiteSpace(_productSpecs) ? string.Empty : _productSpecs; }
            set { _productSpecs = value; }
        }

        ///<Summary>
        /// 当前站点
        ///</Summary>
        public Enum.SiteType CurSite { get; set; }


        //public string CNSiteType { get { return !System.Enum.IsDefined(typeof(SiteType), CurSite) ? string.Empty : EnumConvert.ToDesc(CurSite); } }

        ///<Summary>
        /// 降级等级
        ///</Summary>
        public string QLevel
        {
            get { return string.IsNullOrWhiteSpace(_qLevel) ? string.Empty : _qLevel; }
            set { _qLevel = value; }
        }

        ///<Summary>
        /// 不良类型代码
        ///</Summary>
        public string DowngradeBadTypeCode
        {
            get { return string.IsNullOrWhiteSpace(_downgradeBadTypeCode) ? string.Empty : _downgradeBadTypeCode; }
            set { _downgradeBadTypeCode = value; }
        }

        ///<Summary>
        /// 不良类型名称
        ///</Summary>
        public string DowngradeBadTypeName
        {
            get { return string.IsNullOrWhiteSpace(_downgradeBadTypeName) ? string.Empty : _downgradeBadTypeName; }
            set { _downgradeBadTypeName = value; }
        }

        ///<Summary>
        /// 不良代码
        ///</Summary>
        public string DowngradeBadCode
        {
            get { return string.IsNullOrWhiteSpace(_downgradeBadCode) ? string.Empty : _downgradeBadCode; }
            set { _downgradeBadCode = value; }
        }

        ///<Summary>
        /// 不良原因
        ///</Summary>
        public string DowngradeBadName
        {
            get { return string.IsNullOrWhiteSpace(_downgradeBadName) ? string.Empty : _downgradeBadName; }
            set { _downgradeBadName = value; }
        }

        ///<Summary>
        /// 是否复判
        ///</Summary>
        public bool Reviewed { get; set; }

        ///<Summary>
        /// 复判人
        ///</Summary>
        public int ReviewedBy { get; set; }

        ///<Summary>
        /// 复判时间
        ///</Summary>
        public DateTime? ReviewTime { get; set; }

        ///<Summary>
        /// 复判等级
        ///</Summary>
        public string ReviewLevel
        {
            get { return string.IsNullOrWhiteSpace(_reviewLevel) ? string.Empty : _reviewLevel; }
            set { _reviewLevel = value; }
        }

        ///<Summary>
        /// 复判类型代码
        ///</Summary>
        public string ReviewBadTypeCode
        {
            get { return string.IsNullOrWhiteSpace(_reviewBadTypeCode) ? string.Empty : _reviewBadTypeCode; }
            set { _reviewBadTypeCode = value; }
        }

        ///<Summary>
        /// 复判类型名称
        ///</Summary>
        public string ReviewBadTypeName
        {
            get { return string.IsNullOrWhiteSpace(_reviewBadTypeName) ? string.Empty : _reviewBadTypeName; }
            set { _reviewBadTypeName = value; }
        }

        ///<Summary>
        /// 复判不良代码
        ///</Summary>
        public string ReviewBadCode
        {
            get { return string.IsNullOrWhiteSpace(_reviewBadCode) ? string.Empty : _reviewBadCode; }
            set { _reviewBadCode = value; }
        }

        ///<Summary>
        /// 复判不良名称
        ///</Summary>
        public string ReviewBadName
        {
            get { return string.IsNullOrWhiteSpace(_reviewBadName) ? string.Empty : _reviewBadName; }
            set { _reviewBadName = value; }
        }
        #endregion

        private string _cnReviewedBy = string.Empty;

        /// <summary>
        /// 复判人
        /// </summary>
        public string CNReviewedBy
        {
            get { return string.IsNullOrWhiteSpace(_cnReviewedBy) ? string.Empty : _cnReviewedBy; }
            set { _cnReviewedBy = value; }
        }

        public string ReviewTimeStr { get { return ReviewTime?.ToString("yyyy-MM-dd HH:mms:ss"); } }
    }
}
